<template>
	<div :class="getClassNames">
		<template v-for="item in items" :key="item.codeName">
			<ContextMenuGroupItem
				:loading="loading"
				:item="item"
				@itemClick="handleItemClick"
			></ContextMenuGroupItem>
		</template>
	</div>
</template>

<script setup lang="ts">
import { contextMenuProps } from './context-menu';
import ContextMenuGroupItem from './components/context-menu-group-item.vue';
import { IParam } from '@/core';
const props = defineProps(contextMenuProps);
const emit = defineEmits(['itemClick']);
const getClassNames = computed(() => {
	return {
		'app-context-menu': true,
	};
});

const handleItemClick = (item: IParam, event: MouseEvent) => {
	emit('itemClick', item, event);
};
</script>
